Add codespell support with configuration and fixes - #21
Conversation
Skip: also .git-meta (author-workflow scratch), *.pdf, *.svg. Whitelist: 'eto' — ontology id used in tests/configs/test-edit-obo.yaml (codespell suggests to/ego/veto/wto). Co-Authored-By: Claude Code 2.1.250 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- src/incatools/odk/model.py:926: remaning -> remaining
(adjective before "use of OWLTools" in docstring)
- src/incatools/odk/templates/_dynamic_documentation.jinja2:716: fo -> to
("when adding the component to the ODK configuration file")
Co-Authored-By: Claude Code 2.1.250 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fixed typos:
- accomodates -> accommodates (src/incatools/odk/config.py)
- prefered -> preferred (src/incatools/odk/cli.py)
- Informations/informations -> Information/information (src/incatools/odk/download.py, helper.py)
- overriden -> overridden (src/incatools/odk/{model,setup}.py, templates/src/ontology/Makefile.jinja2)
- instanciate/instanciated -> instantiate/instantiated (src/incatools/odk/template.py)
- editted -> edited (templates/CONTRIBUTING.md.jinja2)
- offical -> official (templates/CONTRIBUTING.md.jinja2)
- updateing -> updating (templates/_dynamic_documentation.jinja2)
- re-use -> reuse (templates/_dynamic_documentation.jinja2)
- multile -> multiple (templates/_dynamic_files.jinja2)
- commmand -> command (templates/src/ontology/Makefile.jinja2)
- inofficial -> unofficial (templates/src/ontology/Makefile.jinja2)
- superceded -> superseded (templates/src/ontology/README-editors.md.jinja2)
- perfoming -> performing (templates/src/sparql/README.md.jinja2)
Co-Authored-By: Claude Code 2.1.250 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
=== Do not change lines below ===
{
"chain": [],
"cmd": "uvx codespell -w",
"exit": 0,
"extra_inputs": [],
"inputs": [],
"outputs": [],
"pwd": "."
}
^^^ Do not change lines above ^^^
- src/incatools/odk/templates/_dynamic_documentation.jinja2:409:
dont -> don't ("If you don't have it yet, ...")
Found via `codespell --builtin clear,rare,usage,code,names`. Other hits
from that pass were legitimate (`ro`/`RO` = Relation Ontology; `master`
and `whitelist` are inclusive-language concerns out of scope here).
Co-Authored-By: Claude Code 2.1.250 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
matentzn
left a comment
There was a problem hiding this comment.
Thanks @yarikoptic for your many years of making these PRs everywhere. Much appreciated.
I am fine this this!
The one thing I'd still like a decision on, @gouttegd: the action is pinned by SHA (which does match v2.2, I checked), but it's a Docker action whose image installs codespell[toml]>=2.2.4 — an open lower bound, rebuilt on every run. Pinning the action doesn't pin the dictionary: any future codespell release that adds a word can turn a perfectly innocent PR red for a typo the contributor didn't write. - I am ok with that but thats your call.
This PR is not to be merged until the requested changes have been made.
|
@yarikoptic thanks again for the PR - will you address the two remaining comments? |
Address review feedback from @gouttegd on PR INCATools#21: - Add `codespell` to the `dev` dependency group in pyproject.toml alongside ruff/mypy/pytest, and invoke it via `uv run codespell` from the existing `code-quality.yml` workflow — avoids spinning up a separate Docker-based action just for the spell check. - Drop the standalone `.github/workflows/codespell.yml`. - Extend the codespell `skip` list with `.venv` and `.*cache` so it doesn't scan uv's virtualenv or mypy/ruff/pytest caches. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
pushed |
gouttegd
left a comment
There was a problem hiding this comment.
Looks all good, thanks!
matentzn
left a comment
There was a problem hiding this comment.
Thank you @yarikoptic
@gouttegd will leave merging to you when you are sweeping.
Add codespell configuration and fix existing typos.
Original motivation: obophenotype/uberon#3759 — codespell fixes in Uberon surfaced typos originating from ODK templates, so it makes sense to add codespell here at the source.
More about codespell: https://github.com/codespell-project/codespell
I personally introduced it to over a hundred of projects already mostly with a positive feedback
(see the "improveit-dashboard").
CI workflow has
permissionsset only toreadso also should be safe.Changes
Configuration & Infrastructure
[tool.codespell]section inpyproject.tomlwith skip patterns andcheck-hidden = true..github/workflows/codespell.ymlrunning on pushes and PRs tomain, usingcodespell-project/actions-codespellpinned by SHA..git,.git-meta,.gitignore,.gitattributes,*.pdf,*.svg.Domain-Specific Whitelist
Added one legitimate term to
ignore-words-list:eto— ontology id used intests/configs/test-edit-obo.yaml(codespell would otherwise suggestto/ego/veto/wto).Ambiguous typos fixed manually (context review)
src/incatools/odk/model.py:926—remaning→remaining(docstring: "impact any remaining use of OWLTools").src/incatools/odk/templates/_dynamic_documentation.jinja2:716—fo→to("when adding the component to the ODK configuration file").Non-ambiguous typos fixed automatically (
codespell -w)Reproducibly via
datalad run(see commit7e0d44d). Notable ones:prefered→preferred,accomodates→accommodates,overriden→overridden,instanciate(d)→instantiate(d).Informations/informations→Information/information(docstrings & help text indownload.py,helper.py).editted→edited,offical→official,updateing→updating,re-use→reuse,multile→multiple,commmand→command,inofficial→unofficial,superceded→superseded,perfoming→performing.Extended-dictionary follow-up pass
Ran
codespell --builtin clear,rare,usage,code,namesand found one further real typo:src/incatools/odk/templates/_dynamic_documentation.jinja2:409—dont→don't.Other extended-pass hits were legitimate and intentionally left alone:
ro/RO— the Relation Ontology identifier, used throughout examples and templates.master,whitelist— inclusive-language concerns, out of scope for a spell-checking PR.Pre-existing grammar tidy-up
src/incatools/odk/config.py:189hadcan accomodatesbefore this PR. Codespell only corrected the spelling (→can accommodates), which left the grammar broken, so the sentence was tweaked tocan accommodate the change.Historical Context
This project has had prior commits manually fixing typos (
Typo fix.,Typo fixes.,More typo fixes.), demonstrating the value of adding automated spell-checking to catch these earlier.Testing
uvx codespellpasses with zero errors on the default builtins after all fixes.Generated with Claude Code and love to typos free code.